//获取应用实例 
var app = getApp()
Page({
    data: {
        pagedisplay: 'none',
        popupdisplay: 'none',
        // 页面配置  
        winWidth: 0,
        winHeight: 0,
        // tab切换 
        currentTab: 0,
        daaress: [
            {
                text: "中瑞万星国际影城",
                daaress: "省体育中心万星国际影城",
                phone: "0591-8727139"
            },
            {
                text: "老板无良",
                daaress: "软件园动漫大楼",
                phone: "18750777958"
            },
        ],
    },
    onLoad: function () {
        var that = this;
        // 获取系统信息 
        wx.getSystemInfo({
            success: function (res) {
                that.setData({
                    winWidth: res.windowWidth,
                    winHeight: res.windowHeight
                });
            }
        });
    },
    // 滑动切换tab 
    bindChange: function (e) {
        var that = this;
        that.setData({ currentTab: e.detail.current });
    },
    // 点击tab切换 
    swichNav: function (e) {
        var that = this;
        if (this.data.currentTab === e.target.dataset.current) {
            return false;
        } else {
            that.setData({
                currentTab: e.target.dataset.current
            })
        }
    },
    //事件处理函数
    address_show: function () {
        console.log(bgColor)
        var bgColor = this.data.pagedisplay == 'block' ? 'none' : 'block';
        // 设置背景颜色数据
        this.setData({
            pagedisplay: bgColor
        });
    },
    //事件处理函数
    address_hide: function () {
        console.log('bgColor')
        var bgColor = this.data.pagedisplay == 'block' ? 'none' : 'block';
        // 设置背景颜色数据
        this.setData({
            pagedisplay: bgColor
        });
    },
    confirm_btn: function () {
        console.log('bgColor1')
        var bgColor1 = this.data.popupdisplay == 'block' ? 'none' : 'block';
        // 设置背景颜色数据
        this.setData({
            popupdisplay: bgColor1
        });
    },
    confirm_hide: function() {
        console.log('bgColor')
        var bgColor = this.data.pagedisplay == 'block' ? 'none' : 'block';
        // 设置背景颜色数据
        this.setData({
            pagedisplay: bgColor
        });
    }
}) 